module CozeApi
  class IndexesController < ApplicationController
    def daily_quotes
      @quotes = RealTime.index "sh000001"
      @quotes["trade_date"] = Time.now.strftime("%Y-%m-%d")
      @index_daily = $TusharePro.tushare_pro("index_daily", ts_code: "000001.SH", "start_date": (Time.now - 20.days).strftime("%Y%m%d"), "end_date": Time.now.strftime("%Y%m%d")).reverse << @quotes

      render json: @index_daily
    end
  end
end